<template>
	<view class="activityList">
		<view class="item" v-for="(item,index) in activity" :key="index">

			<view class="inner">
				<view class="activity-title">
					<view class="userphoto">
						<image :src="'https://www.caikeai.com/api/file/upload/'+item.publishHeadPic" mode="widthFix">
						</image>
					</view>
					<view class="left">
						<text>{{item.publishName}}</text>
						</br>
						<text class="time">{{item.createdTime}}</text>
					</view>

				</view>
			</view>
			<view @tap="gotoDetail(item.id)" class="video-post">
				<view class="title">
					<view class="title">
						{{item.title}}
					</view>
				</view>
				<view class="image-content">
					<view class="image-multiple">
						<view class="image" v-for="(img,idx) in JSON.parse(item.images)" :key="img.url">

							<image :src="'https://www.caikeai.com/api/file/upload/'+img.url" mode="aspectFill">
							</image>
						</view>
					</view>
					<view class="righr">
						<text class="time">{{item.address}}</text>
					</view>
				</view>
				<view class="line-lr">

					<view class="text-left">
						<text>¥{{item.price}}/人</text>
					</view>
					<view class="text-right">
						<text>还剩：{{item.price}}天</text>						
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import config from '@/nxTemp/config/index.config.js';
	export default {
		name: "activityList",
		props: {
			activity: {
				type: Array,
				default: function() {
					return [];
				}
			}
		},
		data() {
			return {

			};
		},
		methods: {
			gotoDetail: function(id) {
				console.log(id);
				uni.navigateTo({
					url: '/pages/detail/detail?id=' + id
				})
			},

		}
	}
</script>

<style lang="scss" scoped>
	.activityList {
		padding-bottom: 60rpx;

		.item {
			padding: 0 30rpx;
			padding-bottom: 10rpx;
			border-bottom: 1rpx solid #f5f5f5;

			.normal-post {
				display: block;
				box-sizing: content-box;
				padding-right: 220rpx;
				min-height: 220rpx;
				position: relative;

				.title {
					padding-top: 10rpx;
					line-height: 52rpx;
					font-size: 36rpx;
					min-height: 150rpx;
					color: #000;
					white-space: normal;
					word-break: normal;
					word-wrap: break-word;
					-webkit-hyphens: auto;
					-ms-hyphens: auto;
					hyphens: auto;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					overflow: hidden;
				}

				.info {

					height: 38rpx;
					display: flex;
					justify-content: space-between;

					text {
						display: inline-block;
						vertical-align: top;
						height: 32rpx;
						line-height: 32rpx;
						font-size: 24rpx;
						color: #969696;
						margin-right: 20rpx;
					}
				}

				.cover {
					position: absolute;
					width: 200rpx;
					height: 200rpx;
					right: 0;
					top: 46rpx;
					-o-object-fit: cover;
					object-fit: cover;


					image {
						width: 200rpx;
						height: 200rpx;
						border-radius: 4px;
					}
				}
			}

			.video-post {
				display: block;

				position: relative;

				.inner {
					width: 100%;
					border-radius: 4px;
					background: #f5f5f5;
					overflow: hidden;
					position: relative;

					.cover {
						display: block;
						width: 100%;
						height: 400rpx;

						image {
							width: 100%;
							height: 400rpx;
						}
					}

					.title {
						padding: 16px 20px 12px;
						line-height: 23px;
						font-size: 17px;
						color: #000;
						font-weight: 700;
					}


				}
			}


		}
	}

	.activity-title {
		margin-top: 5rpx;
		height: 100rpx;
		display: flex;
	}

	.line-lr {
		margin-top: 5rpx;
		height: 100rpx;
		display: flex;
		justify-content: space-between;
	}

	.userphoto {
		width: 70upx;
		height: 70upx;
		border-radius: 100%;
		margin-right: 20upx;
		flex-shrink: 0;
		overflow: hidden;
	}
</style>
